<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Trapezoid Card</title>
  <meta description="https://segmentfault.com/q/1010000042671885">
</head>

<body>

  <div class="container">
    <div class="content">
      <div class="corner">
        <span> 空闲 </span>
      </div>
      <span class="count">256
        <span class="unit"> 台 </span>
      </span>
    </div>
  </div>

  <style>
    :root {
      --card-width: 360px;
      --card-height: 240px;
      --card-background: #fbd839;
      --card-foreground: white;
    }

    .container {
      background-color: var(--card-background);
      position: relative;
      border-radius: 5%;
      width: var(--card-width);
      height: var(--card-height);
    }

    .container .content {
      background-color: var(--card-foreground);
      position: absolute;
      top: 5%;
      left: 5%;
      width: 90%;
      height: 90%;
    }

    .content .corner {
      position: absolute;
      right: 0;
      background: linear-gradient(45deg,
          var(--card-foreground) 0,
          var(--card-foreground) 50%,
          var(--card-background) 50%,
          var(--card-background) 100%);
      width: 100%;
      height: 40%;
    }

    .content .corner span {
      color: var(--card-foreground);
      position: absolute;
      top: 20%;
      right: 10%;
      font-size: 2rem;
      font-weight: bolder;
    }

    .container .content span.count {
      position: absolute;
      top: 50%;
      left: 20%;
      font-size: 3.6rem;
      font-weight: bolder;
      color: black;
    }

    .container .content span.count .unit {
      color: #dedede;
    }

  </style>
</body>

</html>
